﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace StockAnalyzer.HaoStock
{
    internal class Common
    {
        public static Dictionary<string, string> LoadStockNames(string filename= "StockNameInfo.txt")
        {
            Dictionary<string, string> dict = new Dictionary<string, string>();
            if (!File.Exists(filename))
                return dict;

            foreach (var line in File.ReadLines(filename, Encoding.UTF8))
            {
                dict.Add(line.Split(',')[0], line.Split(',')[1]);
            }


            return dict;
        }
    }
}
